const express = require("express");
const router = express.Router();
const pool = require("../../../src/pg/config/pg");
//更新数据
router.post("/edit/", async (req, res) => {
  const id = req.body.id
  const name = req.body.name;
const cloud  = req.body.cloud;
console.log(id,name)
    await pool.query(
      
      "update schg set name=$1, cloud=$2 where  id = $3 ;",
      [name,cloud,id],
      (err, data) => {
        if (err) {
          res.status(200).json(err.message)
          pool.end;
        } else {
          res.status(200).json({ id: "1", name: "删除数据成功" });
          pool.end;
        }
      }
    );
  });
module.exports = router
